<%@ page import="org.internna.iwebjtracker.spring.mvc.IssueController" %>
<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib prefix="iwebjtracker" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c-rt:set var="sessionUser" value="<%= org.internna.iwebmvc.security.UserManager.SESSION_USER %>" />
<c-rt:set var="subsession_id" value="<%= org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter.SUB_SESSION_COOKIE %>" />
<c-rt:set var="subsession_path" value="<%= org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter.SUB_SESSION_COOKIE_PATH %>" />
<c-rt:set var="issue" value="<%= IssueController.ISSUE %>" />
<c-rt:set var="issueVotes" value="<%= IssueController.ISSUE_VOTES %>" />
<c-rt:set var="issueWatchers" value="<%= IssueController.ISSUE_WATCHERS %>" />
<c-rt:set var="lastUpdate" value="<%= IssueController.ISSUE_LAST_UPDATE %>" />
<c-rt:set var="issueClass" value="<%= org.internna.iwebjtracker.model.DefaultIssue.class %>" />
<c-rt:set var="canRequestAssignation" value="<%= IssueController.CAN_REQUEST_WORK_OWNERSHIP %>" />
<c-rt:set var="trackerUser" value="<%= org.internna.iwebjtracker.spring.mvc.IWebJTrackerModelDecoratorInterceptor.TRACKER_USER %>" />
<iwebmvc:panel title="${requestScope[issue].alias}" width="98%;margin:0">
    <table style="text-align:left;width:95%">
        <tbody>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.type" /></td>
                <td style="width:20px"><img src="<c:url value="/resource.iwebmvc?file=/images/common/${fn:toLowerCase(requestScope[issue].type)}_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="" /></td>
                <td style="padding-left:10px"><iwebmvc:message argMessage="Type.${requestScope[issue].type}" /></td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.severity" /></td>
                <td style="width:20px"><img src="<c:url value="/resource.iwebmvc?file=/images/common/${fn:toLowerCase(requestScope[issue].severity)}_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="" /></td>
                <td style="padding-left:10px"><iwebmvc:message argMessage="Severity.${requestScope[issue].severity}" /></td>
            </tr>
            <tr>
                <td id="${requestScope[issue].alias}Status" style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.status" /></td>
                <td style="width:20px"><img id="${requestScope[issue].alias}StatusImage" src="<c:url value="/resource.iwebmvc?file=/images/common/${fn:toLowerCase(requestScope[issue].status)}_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="" /></td>
                <td id="${requestScope[issue].alias}StatusContainer" style="padding-left:10px"><iwebmvc:message argMessage="Status.${requestScope[issue].status}" /></td>
            </tr>
            <tr>
                <td id="${requestScope[issue].alias}ResolutionStatus" style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.resolution" /></td>
                <td style="width:20px"><img id="${requestScope[issue].alias}ResolutionStatusImage" src="<c:url value="/resource.iwebmvc?file=/images/common/${fn:toLowerCase(requestScope[issue].resolutionStatus)}_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="" /></td>
                <td style="padding-left:10px"><iwebmvc:message argMessage="ResolutionStatus.${requestScope[issue].resolutionStatus}" /></td>
            </tr>
        </tbody>
    </table>
</iwebmvc:panel>
<div class="panelSeparator"></div>
<iwebmvc:panel title="ui.issue.environment" width="98%;margin:0">
    <table style="text-align:left;width:95%">
        <tbody>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.component" /></td>
            </tr>
            <tr>
                <td><div style="width:100%;overflow:hidden;height:17px;text-overflow:ellipsis;">${requestScope[issue].parentModule.displayable}</div></td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.affected" /></td>
            </tr>
            <tr>
                <td>${requestScope[issue].affectedVersion}</td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.target" altText="Target version" /></td>
            </tr>
            <tr>
                <td id="${requestScope[issue].alias}TargetDisplayContainer">${requestScope[issue].targetVersion}&nbsp;</td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.fix" /></td>
            </tr>
            <tr>
                <td>${requestScope[issue].fixVersion}</td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.reporter" /></td>
            </tr>
            <tr>
                <td>${requestScope[issue].creator.name}</td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.created" /></td>
            </tr>
            <tr>
                <td>${requestScope[issue].creationDate}</td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.lastupdate" /></td>
            </tr>
            <tr>
                <td>${requestScope[lastUpdate]}</td>
            </tr>
        </tbody>
    </table>
</iwebmvc:panel>
<div class="panelSeparator"></div>
<c:if test="${requestScope[issue].assignee != null}">
    <iwebmvc:panel id="${requestScope[issue].alias}CurrentAssign" title="ui.issue.assigned" width="98%;margin:0">
        <div class="overclear">
            <div class="float_left"><img src="${requestScope[issue].assignee.gravatar}" alt="" /></div>
            <div class="float_right" style="width:50%;">
                <div style="width:100%;overflow:hidden;height:18px;text-align:center;font-weight:bold">${requestScope[issue].assignee.name}</div>
                <div class="label" style="width:100%;height:18px;text-align:center"><c:if test="${requestScope[issue].assignee.location != null}">(${requestScope[issue].assignee.location.displayable})</c:if></div>
                <div style="width:100%;text-align:center;padding-top:5px"><b>Rep: </b>${requestScope[issue].assignee.reputation}
                    <img src="<c:url value="/resource.iwebmvc?file=/images/reputation_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="<iwebmvc:message argMessage="ui.issue.reputation" />" style="vertical-align:bottom" />
                </div>
            </div>
        </div>
    </iwebmvc:panel>
</c:if>
<c:if test="${requestScope[canRequestAssignation]}">
    <iwebmvc:panel id="${requestScope[issue].alias}MyAssign" title="ui.issue.assigned" width="98%;margin:0;display:none;">
        <div class="overclear">
            <div class="float_left"><img src="${requestScope[trackerUser].gravatar}" alt="" /></div>
            <div class="float_right" style="width:50%;">
                <div style="width:100%;overflow:hidden;height:18px;text-align:center;font-weight:bold">${requestScope[trackerUser].name}</div>
                <div class="label" style="width:100%;height:18px;text-align:center"><c:if test="${requestScope[trackerUser].location != null}">(${requestScope[trackerUser].location.displayable})</c:if></div>
                <div style="width:100%;text-align:center;padding-top:5px"><b>Rep: </b>${requestScope[trackerUser].reputation}
                    <img src="<c:url value="/resource.iwebmvc?file=/images/reputation_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="<iwebmvc:message argMessage="ui.issue.reputation" />" style="vertical-align:bottom" />
                </div>
            </div>
        </div>
    </iwebmvc:panel>
</c:if>
<div class="panelSeparator"></div>
<iwebmvc:panel title="ui.issue.community" width="98%;margin:0">
    <table style="text-align:left;width:95%">
        <tbody>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.votes" /></td>
                <td id="${requestScope[issue].alias}Votes">${requestScope[issueVotes]}</td>
                <td><img src="<c:url value="/resource.iwebmvc?file=/images/common/vote_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="" style="vertical-align:bottom" /></td>
            </tr>
            <tr>
                <td style="font-weight:bold"><iwebmvc:message argMessage="ui.issue.watchers" /></td>
                <td id="${requestScope[issue].alias}Watchers">${requestScope[issueWatchers]}</td>
                <td><img src="<c:url value="/resource.iwebmvc?file=/images/common/watcher_${sessionScope[sessionUser].theme}.gif&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" alt="" /></td>
            </tr>
        </tbody>
    </table>
</iwebmvc:panel>